package com.zyl.ag.bean;

import com.zyl.util.DateUtil;

public class Record {
	//record 每笔操作都记录 不论是买入还是卖出 买空 卖空
	private Integer _id  ; //
	private String name ; // 是谁买的
	private Integer num  ; //买入的量
	private Integer price; //买入的价钱
	private Integer type ; //  买多1  买空 -1  
	private Integer deal ; //  是买1 卖-1
 	private Integer money; // 盈利多少钱 如果没有被卖掉就是 负的 1000克白银的20%
	private Long date ; //  买入日期 
	
	
	
	public Record( ) {
		super();
		}
	public Record( String name, Integer num, Integer price,
			Integer type, Integer deal, Integer money, Long date) {
		super();
		
		this.name = name;
		this.num = num;
		this.price = price;
		this.type = type;
		this.deal = deal;
		this.money = money;
		this.date = date;
	}
	public Integer get_id() {
		return _id;
	}
	public void set_id(Integer _id) {
		this._id = _id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Integer getNum() {
		return num;
	}
	public void setNum(Integer num) {
		this.num = num;
	}
	public Integer getPrice() {
		return price;
	}
	public void setPrice(Integer price) {
		this.price = price;
	}
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	public Integer getDeal() {
		return deal;
	}
	public void setDeal(Integer deal) {
		this.deal = deal;
	}
	public Integer getMoney() {
		return money;
	}
	public void setMoney(Integer money) {
		this.money = money;
	}
	public Long getDate() {
		return date;
	}
	public void setDate(Long date) {
		this.date = date;
	}
	@Override
	public String toString() {
		String stype="多单";
		if(type==-1){
			 stype="空单";
		}
		String sdeal="买入";
		if(deal==-1){
			sdeal="卖出";
		}
		
		
		return  " " + name + sdeal + num+"手 "
				+ stype+ " 价钱" + price +   " 押金" + money + " " +DateUtil.toString(date)   ;
	}
	
}
